package br.com.sgmf.model;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;

@Entity
public class Funcionario implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue
	private Integer id;
	@Column(length = 6, nullable = false)
	private String matricula;
	@Column(length = 40, nullable = false)
	private String nome;
	@Column(length = 11, nullable = false)
	private String cpf;

	@Enumerated(EnumType.STRING)
	private FuncaoEnum funcao;

	@Enumerated(EnumType.STRING)
	private SetorEnum setor;

	@OneToOne(cascade = CascadeType.PERSIST)
	@JoinColumn(name = "endereco_id")
	private Endereco endereco;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getMatricula() {
		return matricula;
	}

	public void setMatricula(String matricula) {
		this.matricula = matricula;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getCpf() {
		return cpf;
	}

	public void setCpf(String cpf) {
		this.cpf = cpf;
	}

	public FuncaoEnum getFuncao() {
		return funcao;
	}

	public void setFuncao(FuncaoEnum funcao) {
		this.funcao = funcao;
	}

	public SetorEnum getSetor() {
		return setor;
	}

	public void setSetor(SetorEnum setor) {
		this.setor = setor;
	}

	public Endereco getEndereco() {
		return endereco;
	}

	public void setEndereco(Endereco endereco) {
		this.endereco = endereco;
	}

}
